home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / RMI_OS / RMI-PREB / EXAMPLES / STOCK / STOCKWAT.JAV < prev   
Encoding:
Text File  |  1996-11-08  |  2.5 KB  |  69 lines

  1. /*
  2.  * %W% %E%
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_pre-beta
  20.  */
  21. package examples.stock;
  22.  
  23. import java.rmi.*;
  24.  
  25. /**
  26.  * The StockWatch remote interface is used to register interest in
  27.  * receiving stock updates.
  28.  */
  29. public interface StockWatch extends java.rmi.Remote {
  30.  
  31.     /**
  32.      * Request notification of stock updates.
  33.      * @param stock the stock name
  34.      * @param obj the remote object to be notified
  35.      * @return the latest update of the stock
  36.      * @exception StockNotFoundException if stock is not known
  37.      * @exception RemoteException if some communication failure occurs
  38.      */
  39.     Stock watch(String stock, StockNotify obj)
  40.     throws StockNotFoundException, RemoteException;
  41.  
  42.     /**
  43.      * Cancel request for stock updates for a particular stock.
  44.      * @param stock the stock name
  45.      * @param obj the remote object canceling the notification
  46.      * @exception RemoteException if some communication failure occurs
  47.      */
  48.     void cancel(String stock, StockNotify obj) throws RemoteException;
  49.  
  50.     /**
  51.      * Returns an array of stock update information for the stocks
  52.      * already registered by the remote object.
  53.      * @param obj the remote object
  54.      * @return the list of stocks, or null if obj is not watching any
  55.      *  stocks
  56.      * @exception RemoteException if some communication failure occurs
  57.      */
  58.     Stock[] list(StockNotify obj) throws RemoteException;
  59.  
  60.     /**
  61.      * Cancel all requests for stock updates for the remote object.
  62.      * @param obj the remote object canceling the request
  63.      * @exception RemoteException if some communication failure occurs
  64.      */
  65.     void cancelAll(StockNotify obj) throws RemoteException;
  66. }
  67.  
  68.     
  69.